Import mojo
Import agfx

Class TTiled_TilesetImage
	
	Private
	Field source:String 	
	Field width:Int
	Field height:Int

	Public
	Field atlas:TImage


	'------------------------------------------------------------------------------------
	'
	'------------------------------------------------------------------------------------
	
	Method New(node:XMLElement)
	
		If DEBUG Then Print("    <IMAGE>")
		
		Self.source = node.GetAttribute("source")
		If DEBUG Then Print("    source: "+Self.source)
		
		Self.width 	= Int(node.GetAttribute("width"))
		If DEBUG Then Print("    width: "+Self.width)
		
		Self.height = Int(node.GetAttribute("height"))
		If DEBUG Then Print("    height: "+Self.height)
		
	End Method

	'------------------------------------------------------------------------------------
	' LoadImage
	'------------------------------------------------------------------------------------
	Method Load(w:Int,h:Int)		
		Self.atlas = IMAGES.LoadTileset(Self.source,w,h)
	End Method
	
End Class